var stdin = process.stdin
/**stdin继承了EventEmitter
 * 继承了stream.Readable
 */
//输入内容
stdin.on('data',function(chunk){
    var chunk = chunk.toString('utf-8')
    var result = chunk.slice(0,-2)
    if(result == ""){
        stdin.emit('end')
    }
})
stdin.on('end',function(){
    console.log('stdin ended')
})